/**
 *     This file is part of cesm-ws.
 *
 *     cesm-ws, Web Service for Community Earth System Model
 *
 *     Copyright (c) 2010, Purdue University and/or affilicates or thrid-party contributors as
 *     indicated by the @author tags or express copyright attribution statements
 *     applied by the authors. All third-party contributions are distributed under
 *     license by Purdue University.
 *
 *     cesm-ws is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU Lesser General Public License
 *     along with this distribution.  If not, see <http://www.gnu.org/licenses/>.
 */

package edu.purdue.rcac.cesm.facade.bean;

import edu.purdue.rcac.cesm.persistence.model.CESMCaseConfig;
import edu.purdue.rcac.cesm.persistence.model.CESMCaseConfig.AccessLevel;
import edu.purdue.rcac.cesm.persistence.model.CESMCaseConfig.CaseStage;
import edu.purdue.rcac.service.dispatch.AbstractResponse.Outcome;

public class CaseConfigInfoBean {

	private String outcome;
	private String resolution;
	private String componentSet;
	private String accessLevel;
	private int resubmit;
	private String owner;
	private String name;
	private String stage;
	private String startDate;
	private String endDate;
	private String duration;
	private String creationTime;

	public CaseConfigInfoBean() {
		super();
		this.outcome = Outcome.SUCCESS.toString();
		this.owner = "";
		this.name = "";
		this.accessLevel = AccessLevel.PUBLIC.toString();
		this.stage = CaseStage.NONE.toString();
		this.creationTime = "";

		this.resolution = "";
		this.componentSet = "";
		this.resubmit = 0;

		this.startDate = "0001-01-01";
		this.duration = "5:ndays";
		this.endDate = "0001-01-06";
	}

	public CaseConfigInfoBean(String outcome, CESMCaseConfig c) {
		super();
		this.outcome = outcome;

		if (c != null) {
			this.owner = c.getOwner();
			this.name = c.getName();
			this.accessLevel = c.getAccessLevel().toString();
			this.stage = c.getStage().toString();
			this.creationTime = c.getCreationTime().toString();

			this.resolution = c.getResolution().toString();
			this.componentSet = c.getComponentSet().toString();
			this.resubmit = c.getResubmit();

			this.startDate = c.getStartDate().toString();
			this.duration = c.getDuration();
			this.endDate = c.getDuration();
		}
	}

	public String getOwner() {
		return owner;
	}

	public void setOwner(String owner) {
		this.owner = owner;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getStage() {
		return stage;
	}

	public void setStage(String stage) {
		this.stage = stage;
	}

	public String getCreationTime() {
		return creationTime;
	}

	public void setCreationTime(String creationTime) {
		this.creationTime = creationTime;
	}

	public String getOutcome() {
		return outcome;
	}

	public void setOutcome(String outcome) {
		this.outcome = outcome;
	}

	public String getResolution() {
		return resolution;
	}

	public void setResolution(String resolution) {
		this.resolution = resolution;
	}

	public String getComponentSet() {
		return componentSet;
	}

	public void setComponentSet(String componentSet) {
		this.componentSet = componentSet;
	}

	public String getAccessLevel() {
		return accessLevel;
	}

	public void setAccessLevel(String accessLevel) {
		this.accessLevel = accessLevel;
	}

	public int getResubmit() {
		return resubmit;
	}

	public void setResubmit(int resubmit) {
		this.resubmit = resubmit;
	}

	public String getStartDate() {
		return startDate;
	}

	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}

	public String getEndDate() {
		return endDate;
	}

	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}

	public String getDuration() {
		return duration;
	}

	public void setDuration(String duration) {
		this.duration = duration;
	}
}
